#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<fcntl.h>
#include<unistd.h>

int main(int argc,const char* argv[]){
    if(argc != 3){
        return -1;
    }
    FILE* fp_r = fopen(argv[1],"r");
    if(fp_r == NULL){
        perror("fopen err");
        return -1;
    }
    printf("________fopen read success_______\n");

    FILE* fp_w = fopen(argv[2],"w");
    if(fp_w == NULL){
        perror("fopen err");
        fclose(fp_r);
        fp_r=NULL;
        return -1;
    }
    printf("________fopen write success_______\n");
    
    char ch[32]={0};
    while( 1 ){
        if( fwrite(ch,sizeof(char),fread(ch,sizeof(char),sizeof(char),fp_r),fp_w) <= 0){
            break;
        }
    }

    
    fclose(fp_r);
    fclose(fp_w);
    fp_w=NULL;
    fp_r=NULL;
    return 0;
}